﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeederSerialPort
{
    /// <summary>
    /// 串口参数设置类
    /// </summary>
    public class ComParameterConfig
    {
        public ComParameterConfig()
        {
            Port = System.Enum.GetValues(typeof(Port));
            CheckMode = System.Enum.GetValues(typeof(CheckMode));
            StopBit = System.Enum.GetValues(typeof(StopBit));
            BaudRate = new List<int>() { 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, };
            DataBit = new List<int>() { 6, 7, 8 };
        }

        private Array port;
        private Array checkMode;
        private Array stopBit;
        private List<int> dataBit;
        private List<int> baudRate;
        private string aaa;

        /// <summary>
        /// 端口
        /// </summary>
        public Array Port
        {
            get { return port; }
            set { port = value;}
        }

        /// <summary>
        /// 端口
        /// </summary>
        public string abc
        {
            get { return ""; }
            set { aaa = value;}
        }

        /// <summary>
        /// 校验模式
        /// </summary>
        public Array CheckMode
        {
            get { return checkMode; }
            set { checkMode = value;}
        }

        /// <summary>
        /// 停止位
        /// </summary>
        public Array StopBit
        {
            get { return stopBit; }
            set { stopBit = value;}
        }

        /// <summary>
        /// 波特率
        /// </summary>
        public List<int> BaudRate
        {
            get { return baudRate; }
            set { baudRate = value;}
        }

        /// <summary>
        /// 数据位
        /// </summary>
        public List<int> DataBit
        {
            get { return dataBit; }
            set { dataBit = value;}
        }

    }
}
